In standard , the argument to the \label
command cannot
contain anything but characters (after expansion). In the geom
style, this restriction is lifted, so labels contain just about
anything. For example, \label{\TeX}
and
\label{Isometries of $\bold R^2$}
are acceptable. Macros are
no longer expanded.
One advantage of this flexibility is that subdivisions can be
automatically labeled by their titles. In the geom
format, by
default, every sectioning command such as \section
generates a
label with its title. If this feature causes you to run out of
memory, you can turn it off by saying \autolabelfalse
in your
document's preamble.
To refer to the place where a label occurs, you can still use the
\ref
command, as in standard . This gives a bald
number—for example, \ref{
Isometries of $\bold R^2$}
will
print ``8.3'' if Section 8.3 starts with \section{Isometries of $\bold R^2$}
while automatic labeling is in effect.
A new feature is that you can
replace \ref
by \fullref
or \Fullref
, to get
``section 8.3'' or ``Section 8.3'', respectively.
The way \fullref
works is by storing in a certain register the
type of environment in which a label was created. Thus, when
a new section starts, this register gets the value ``section''. When
a \begin
command introducing
one of the environments described in Theorems and Their Friends is encountered
inside this section, the register gets updated to the type of that
environment, say ``theorem''. It reverts to ``section'' when
the matching \end
command is read.
Even if you have nested environments, labels placed in each of them are assigned the correct type. Consider the input
\newtheorem[{\par\large}{\it}]{theorem}{Theorem}[section] \equationwith{theorem} % These two lines are explained ... % in later sections \begin{theorem}[Erd\"os] A theorem both deep and profound / Is that a circle is round: \begin{equation} \mathrm{curvature}\,S^1=\mathrm {const}. \label{circle} \end{equation} In a paper by Erd\"os / Written in Kurdish / A counterexample is found. \label{Kurdish} \end{theorem}which gives
\Fullref{Erd\"os}
gives ``Erdös'',
\Fullref{circle}
gives ``circle'', and
\Fullref{Kurdish}
gives ``Kurdish''. Furthermore,
\ref*{Erd\"os}
gives ``Erdös'', that is, it prints the
(optional) tag associated with theorems and the like. Of course you
can also use \fullref*
and \Fullref*
.
to *If you disagree with 's idea of what the label type should be
at a particular point, you can override is using \setlabeltype
.
For example, if we had \setlabeltype{formula}
right before the
\label
command in the previous example, the result of
\Fullref{circle}
would be ``Formula '' instead of
``circle''.
Before \ref
actually prints the number of a cross-reference, it
applies the macro \preref
to it. By default, this macro does
nothing; but you can redefine it to do whatever you want with the
number. If you want the number to appear upright even if the
surrounding text is in italics, you can say
\def\preref#1{{\normalshape#1}}The output of
\pageref
and of \cite
is also passed to
\pageref
before being printed.